/*
 *     This file is part of Mobile GPS Logger.
 * 
 *     Mobile GPS Logger is free software: you can redistribute it and/or
 *     modify it under the terms of the GNU General Public License as
 *     published by the Free Software Foundation, either version 3 of the
 *     License, or (at your option) any later version.
 * 
 *     Mobile GPS Logger is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU General Public License v3 for more details.
 * 
 *     You should have received a copy of the GNU General Public License v3
 *     along with Mobile GPS Logger. If not, see <http://www.gnu.org/licenses/>.
*/


package cx.ath.skyflyer.gpslog;

import java.io.IOException;
import javax.microedition.lcdui.Alert;
import javax.microedition.lcdui.Display;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;

/**
 *
 * @author Ahti Legonkov
 */
public class FileListTest extends MIDlet implements FileNameListener {

    public FileListTest() {
    }

    protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
    }

    protected void pauseApp() {
    }

    protected void startApp() throws MIDletStateChangeException {
//        try {
            Alert a = new Alert("done!");
            FileList fl = new FileList(Configuration.getLogPath(), "Select file");
            Display.getDisplay(this).setCurrent(fl);
//        }
//        catch (IOException ex) {
//            Alert a = new Alert(ex.toString());
//            Display.getDisplay(this).setCurrent(a);
//        }
    }

    public void fileSelected(String filePath) {
        System.out.println("Selected: " + filePath);
    }
}
